﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BrnMall.Manager.Domain.Restaurant;

namespace BrnMall.Web.StoreAdmin.Models
{
    #region 排队

    public class LineItemModel
    {
        /// <summary>
        /// 数据标号
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 店铺ID
        /// </summary>
        public int StoreId { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 前缀
        /// </summary>
        public string StartCode { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int DisplayOrder { get; set; }
        /// <summary>
        /// 下个取号号码
        /// </summary>
        public int NextNumber { get; set; }
        /// <summary>
        /// 当前叫号
        /// </summary>
        public int CurrNumber { get; set; }
        /// <summary>
        /// 排队人数
        /// </summary>
        public int PendingCount { get; set; }
    }
    public class EditLineItemModel
    {
        /// <summary>
        /// 数据标号
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Required]
        public string Name { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 前缀
        /// </summary>
        [Required]
        [StringLength(1)]
        [RegularExpression("[a-zA-Z]", ErrorMessage = "只支持大小写a-z英文字母")]
        public string StartCode { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        [Required]
        [Range(1, int.MaxValue, ErrorMessage = "排序不能小于0")]
        public int DisplayOrder { get; set; }

        public EditLineItemModel()
        {
            DisplayOrder = 1;
        }

    }

    #endregion

    #region 餐位

    public class DiningTableListModel
    {
        public IList<DiningTableType> TableTypes { get; set; }
        public IList<DiningTableViewModel> DiningTables { get; set; }
    }

    public class DiningTableViewModel
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int StoreId { get; set; }
        public DiningTableType TableType { get; set; }
        public string TableNumber { get; set; }
        public int DiningState { get; set; }
        public string QrCodeUrl { get; set; }
    }
    public class DiningTableModel
    {
        public int Id { get; set; }
        [Required]
        public string Name { get; set; }
        public int StoreId { get; set; }
        [Required]
        public int TableTypeId { get; set; }
        [Required]
        public string TableNumber { get; set; }
        public int DiningState { get; set; }

        public DiningTableModel()
        {
            DiningState = 0;
        }
    }
    public class DiningTableTypeModel
    {
        public int Id { get; set; }
        public int StoreId { get; set; }
        [Required]
        public string Name { get; set; }
    }
    #endregion

}
